Recently, in a nonvolatile semiconductor memory device such as a NAND flash memory, a write operation is performed in loops including a program and a program verification. For example, if a power voltage drops during the period of the program verification, a verification result may be an erroneous judgment. If the erroneous judgment occurs in the program verification, troubles occur; a program is repeated for a memory cell which has already completed a program (over-program), or the transition is made to the program of a next memory cell even though a program has not been completed. In this case, for example, error detection and correction (ECC) is used to correct written data.